public class demo03 {
    //二叉树的镜像
    public static class TreeNode {
        int val = 0;
        TreeNode left = null;
        TreeNode right = null;

        public TreeNode(int val) {
            this.val = val;
        }
    }
    public static TreeNode Mirror (TreeNode pRoot) {
        if(pRoot==null){
            return pRoot;
        }
        if(pRoot.left==null&&pRoot.right==null){
            return pRoot;
        }

        TreeNode tmp=pRoot.left;
        pRoot.left=pRoot.right;
        pRoot.right=tmp;

        Mirror(pRoot.left);
        Mirror(pRoot.right);

        return pRoot;
    }

}
